<template>
  <div>
    <button @click="test1">点我获取学生信息</button>
    <button @click="test2">点我获取汽车信息</button>
    <button @click="test3">点我获取新闻</button>
  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    name:'App',
    methods: {
      async test1(){
        let result = await axios.get('/api1/students')
        console.log(result.data)
      },
      async test2(){
        let result = await axios.get('/api2/cars')
        console.log(result.data)
      },
      async test3(){
        let result = await axios.get('/api3/widget?id=LocalNews&ajax=json')
        console.log(result.data.data.LocalNews.data.rows.first)
      }
    },
  }
</script>